package main

//nacos 健康检查
import (
	capi "github.com/hashicorp/consul/api"
)

func main() {
	// Get a new client
	client, err := capi.NewClient(&capi.Config{
		Address: "121.36.228.151:8500", //传自己的主机地址和端口
		Scheme:  "http",
	})
	if err != nil {
		panic(err)
	}
	ag := client.Agent() //代理
	err = ag.ServiceRegister(&capi.AgentServiceRegistration{
		ID:      "123",
		Name:    "server",
		Tags:    []string{"grpc"},
		Port:    8500,
		Address: "127.0.0.1",
	})
	if err != nil {
		return
	}

}
